import request from "@/utils/request";
import { queryParams } from '@/utils/utils'

interface orderParam {
    page: number
    tab: string
    limit?: string
    title?: string
    category_id?: number,
    no?: string
}
export const getOrdersList = (params: orderParam) => {
    let { page, tab, limit, title, category_id, no } = params
    let r = queryParams({ tab, limit, title, category_id, no })
    return request({
        url: `/order/${page}${r}`,
        method: "get",
    });
};


// 删除
export const delOrders = (ids: any) => {
    ids = Array.isArray(ids) ? ids : [ids]
    return request({
        url: `/order/delete_all`,
        method: "POST",
        data: {
            ids
        }
    });
};